/**
 * 
 */
package cn.com.xf.web.form;

import java.text.SimpleDateFormat;

import org.apache.commons.lang.StringUtils;
import org.hibernate.validator.constraints.NotEmpty;

import cn.com.xf.domain.TblSiteNews;

/**
 * @author Administrator
 * 
 */
public class SiteForm extends BaseForm {
	private String module;
	private String name;
	@NotEmpty(message = "内容不能为空")
	private String content;
	private String contentEn;
	private String contentBig5;
	private String id;
	private String newsSource;
	private String type;
	private String publicTime;
	private String publicMan;
	@NotEmpty(message = "标题不能为空")
	private String title;
	private String newsAbstract;
	private String isimportant;
	private String istop;
	private String isShow;
	private String group;

	private String videoTitle;
	private String videoDesc;

	private String pageTitle;// seo三项
	private String pageKeywords;
	private String pageDescription;

	private String grayType; //网站素装 0正常1灰色2红色 
	private String weeklyId;

	public String getWeeklyId() {
		return weeklyId;
	}

	public void setWeeklyId(String weeklyId) {
		this.weeklyId = weeklyId;
	}

	public String getContentBig5() {
		return contentBig5;
	}

	public void setContentBig5(String contentBig5) {
		this.contentBig5 = contentBig5;
	}

	public String getContentEn() {
		return contentEn;
	}

	public void setContentEn(String contentEn) {
		this.contentEn = contentEn;
	}

	public String getGrayType() {
		return grayType;
	}

	public void setGrayType(String grayType) {
		this.grayType = grayType;
	}

	public String getVideoTitle() {
		return videoTitle;
	}

	public void setVideoTitle(String videoTitle) {
		this.videoTitle = videoTitle;
	}

	public String getVideoDesc() {
		return videoDesc;
	}

	public void setVideoDesc(String videoDesc) {
		this.videoDesc = videoDesc;
	}

	public String getGroup() {
		return group;
	}

	public void setGroup(String group) {
		this.group = group;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getNewsSource() {
		return newsSource;
	}

	public void setNewsSource(String newsSource) {
		this.newsSource = newsSource;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public String getPublicTime() {
		return publicTime;
	}

	public void setPublicTime(String publicTime) {
		this.publicTime = publicTime;
	}

	public String getPublicMan() {
		return publicMan;
	}

	public void setPublicMan(String publicMan) {
		this.publicMan = publicMan;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getNewsAbstract() {
		return newsAbstract;
	}

	public void setNewsAbstract(String newsAbstract) {
		this.newsAbstract = newsAbstract;
	}

	public String getIsimportant() {
		return isimportant;
	}

	public void setIsimportant(String isimportant) {
		this.isimportant = isimportant;
	}

	public String getIstop() {
		return istop;
	}

	public void setIstop(String istop) {
		this.istop = istop;
	}

	public String getModule() {
		return module;
	}

	public void setModule(String module) {
		this.module = module;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public TblSiteNews copyTo() throws Exception {
		TblSiteNews news = new TblSiteNews();
		news.setNewsSource(this.newsSource);
		news.setType(this.type);

		if (StringUtils.isBlank(this.id)) {
			news.setPublicTime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(this.publicTime));
			news.setPublicTimeStr(this.publicTime);
		}

		news.setPublicMan(this.publicMan);
		news.setNewsAbstract(this.newsAbstract);
		news.setTitle(this.title);
		news.setContent(this.content);
		if (!StringUtils.isNotBlank(this.istop)) {
			this.istop = "0";
		}
		if (!StringUtils.isNotBlank(this.isimportant)) {
			this.isimportant = "0";
		}
		if (!StringUtils.isNotBlank(this.isShow)) {
			this.isShow = "1";
		}
		news.setIsImportant(this.isimportant);
		news.setIsTop(this.istop);
		news.setIsShow(this.isShow);
		return news;
	}

	public String getPageTitle() {
		return pageTitle;
	}

	public void setPageTitle(String pageTitle) {
		this.pageTitle = pageTitle;
	}

	public String getPageKeywords() {
		return pageKeywords;
	}

	public void setPageKeywords(String pageKeywords) {
		this.pageKeywords = pageKeywords;
	}

	public String getPageDescription() {
		return pageDescription;
	}

	public void setPageDescription(String pageDescription) {
		this.pageDescription = pageDescription;
	}

	public String getIsShow() {
		return isShow;
	}

	public void setIsShow(String isShow) {
		this.isShow = isShow;
	}
}
